﻿@model Actya.Core.SiteStructure.SitemapNode
<div class="sitemapitem-edit extra" data-nodeid="@Model.Id">
	@using (Html.BeginForm("UpdateAjax", "Sitemap")) {
		@Html.AntiForgeryToken()
		@Html.HiddenFor(m => m.Id)
		<fieldset>
			<div class="inline">
				@Html.LabelFor(m => m.Title)
				@Html.TextBoxFor(m => m.Title, new { @class="fe-middle" })
				@Html.ValidationMessageFor(m => m.Title)
			</div>
			<div class="inline">
			@if (Model.PageId != null)
			{
				@Html.HiddenFor(m => m.PageId)
				@Html.HiddenFor(m => m.Url)
				<label>Page</label>
				<span class="fe-readonly">@ViewBag.PageTitle (@ViewBag.PageUrl)</span>
				@Html.ActionLink("Edit page", "Update", "Pages", new { id= Model.PageId }, null)
			}
			else 
			{
				@Html.LabelFor(m => m.Url)
				@Html.TextBoxFor(m => m.Url, new { @class = "fe-middle" })
			}		
			</div>
			<div>
				<div class="inline">
					@Html.CheckBoxFor(m => m.ShowInNavigation)
					<label for="ShowInNavigation" class="inline">Show in navigation</label>
				</div>
				<div class="inline">
					@Html.CheckBoxFor(m => m.ShowInSitemap)
					<label for="ShowInSitemap" class="inline">Show in sitemap</label>
				</div>
			</div>
		</fieldset>
		<input type="submit" value="Update" /> 
		<text>or</text>
		<a href="#" class="cancellink">Cancel</a>
	}
</div>
